<template>
<div class="baiodan">
<h3>	HP/惠普 Spectre Laptop 13超薄笔记本电脑 8代CPU超极本商务本

</h3>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  
<h3>价格：1999元</h3>

<el-form-item label="选择颜色" prop="resource">
    <el-radio-group v-model="ruleForm.resource">
      <el-radio label="银白色"></el-radio>
      <el-radio label="黄金色"></el-radio>
     <el-radio label="黑色"></el-radio>
    </el-radio-group>
  </el-form-item>

  <el-form-item label="选择套餐" prop="resource">
    <el-radio-group v-model="ruleForm.resour">
      <el-radio label="套餐一"></el-radio>
      <el-radio label="套餐二"></el-radio>
    </el-radio-group>
  </el-form-item>
	<el-switch
  v-model="value3"
  active-text="按月付费"
  inactive-text="按年付费">
</el-switch>
  <el-form-item>

    <el-button type="primary" @click="submitForm('ruleForm')">立即购买</el-button>
    
  </el-form-item>

  <el-form-item label="备注">
    <el-input type="textarea" v-model="ruleForm.desc"></el-input>
  </el-form-item>

</el-form>
</div>
</template>
<script>
  export default {
    data() {
      return {
        ruleForm: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        rules: {
          name: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          region: [
            { required: true, message: '请选择活动区域', trigger: 'change' }
          ],
          date1: [
            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
          ],
          date2: [
            { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
          ],
          type: [
            { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
          ],
          resource: [
            { required: true, message: '请选择颜色', trigger: 'change' }
          ],
          desc: [
            { required: true, message: '请选择套餐', trigger: 'blur' }
          ]
        }
      };
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('支付中!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>

<style>
.el-rate{margin-left:80px;margin-top:-10px;}
.el-switch{margin-bottom:20px;}
.baiodan{
width:600px;
position: relative;
margin-left:900px;
}
</style>
